<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>新立方管理系统</title>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/common.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/main.css" />
<script type="text/javascript" src="<%=basePath%>js/libs/modernizr.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jquery-1.10.2.min.js"></script>

<script type="text/javascript">
	
	 $(function(){
		  $.ajax({
             type: "GET",
             url: "/catalog/showcatalog",
             //data: {username:$("#username").val(), content:$("#content").val()},
             dataType: "json",
             success: function(data){
             
             var cataHtml = "<td><select name='catalogId' id='catalogId'><option value=''>请选择</option>";
										
             	for(var i = 0 ; i< data.rows.length ; i++){
       					cataHtml += "<option value='"+data.rows[i].c_id+"' >"+data.rows[i].name+"</option>";
             	}
             	cataHtml = cataHtml + "</select></td>";
             	/* alert(cataHtml); */
             	$('#catalog').empty().html(cataHtml);
             	var temp = '<%=request.getParameter("catalogId")%>';
						if (temp == 'null')
							temp = '';
						$("#catalogId").val(temp);

					}
				});

	})
</script>
<script type="text/javascript">
$(function () {
var x = 10;
var y = 20;
$("a.tooltip").mouseover(function (e) {
this.myTitle = this.title;
this.title = "";
var imgTitle = this.myTitle ? "<br />" + this.myTitle + " 产品预览图" : "";
var tooltip = "<div id='tooltip'><img src='" + this.href + "' alt='' width='200' height='200' />" + imgTitle + "</div>";
$("body").append(tooltip);
$("#tooltip")
.css({
"top": (e.pageY + y) + "px",
"left": (e.pageX + x) + "px"
}).show("fast");
}).mouseout(function (e) {
this.title = this.myTitle;
$("#tooltip").remove();
}).mousemove(function (e) {
$("#tooltip").css({
"top": (e.pageY + y) + "px",
"left": (e.pageX + x) + "px"
});
});
})
</script>
<style>
/* ul{margin: 30px auto; width:1440px;}
ul li{float: left; padding-right: 20px; list-style: none;}
ul li img{width: 77px; height: 57px; padding: 6px; border: 1px solid #ccc; background-color:#eee; -webkit-border-radius: 8px;}
*/
#tooltip{
position: absolute;
background-color: #eee;
border: 1px solid #999;
width: 200px;
height: 200px;
-webkit-border-radius: 8px;
font-family: "微软雅黑";
padding: 20px;
} 
</style>


</head>
<body>
  <div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
      <div class="topbar-logo-wrap clearfix">
        <ul class="navbar-list clearfix">
          <li><a class="on" href="#">新立方管理系统</a>
          </li>
        </ul>
      </div>
      <div class="top-info-wrap">
        <ul class="top-info-list clearfix">
          <li><a href="#">退出</a>
          </li>
        </ul>
      </div>
    </div>
  </div>
  <div class="container clearfix">
    <div class="sidebar-wrap">
      <div class="sidebar-content">
        <ul class="sidebar-list">
          <li><a href="#"><i class="icon-font">&#xe003;</i>主材部</a>
            <ul class="sub-menu">
              <li><a href="<%=basePath + "product/index"%>"><i class="icon-font">&#xe008;</i>商品管理</a>
              </li>
              <li><a href="<%=basePath + "factory/product"%>"><i class="icon-font">&#xe006;</i>厂家管理</a>
              </li>
              <li><a href="<%=basePath + "order/index"%>"><i class="icon-font">&#xe005;</i>订单管理</a>
              </li>
               <c:if test="${sessionScope.xlf_userType== '10' }">
              <li><a href="<%=basePath + "user/index"%>"><i class="icon-font">&#xe009;</i>管理员管理</a>
              </li>
               </c:if>
              <li><a href="<%=basePath + "product/mail"%>"><i class="icon-font">&#xe004;</i>邮件配置</a>
              </li>
               <li><a href="<%=basePath + "email/index"%>"><i class="icon-font">&#xe012;</i>邮件记录</a>
              </li>
            </ul></li>

        </ul>
      </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">
      <div class="crumb-wrap">
        <div class="crumb-list">
          <i class="icon-font"></i><a href="/product/index">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">邮件记录</span>
        </div>
      </div>
     
     
      <div class="result-wrap">
     
        <form name="myform" id="myform" method="post">
          <div class="result-content">
            <table class="result-tab" width="100%">
              <tr>
                <th width="3%">No.</th>
                <th>时间</th>
                <th>订单号</th>
                <th>客户姓名</th>
                <th>厂家名称</th>
                <th>邮箱地址</th>
                <th>发送结果</th>
                <th>异常描述</th>
                
              </tr>
              <c:forEach items="${pageRecord.list }" var="p" varStatus="s">
                <tr>
                  <td>${s.index + 1}</td>
                  <td>${p.createtime}</td>
                  <td>${p.o_id}</td>
                  <td>${p.custername}</td>
                  <td>${p.factoryname}</td>
                  <td>${p.email}</td>
                  <td>${p.result}</td>
                  <td>${p.exceptiondesc}</td>

                </tr>
              </c:forEach>
            </table>

              <div class="list-page">
              <span> 共 ${pageRecord.totalRow } 条 ${pageRecord.pageNumber }/${pageRecord.totalPage } 页 </span>
              <fmt:parseNumber var="totalPageNumber" value="${pageRecord.totalPage }" type="number"></fmt:parseNumber>
              <span style="float:right"> <c:if test="totalPageNumber > 5">
                  <c:set var="totalPageNumber" value="5"></c:set>
                </c:if> <c:if test="totalPageNumber <= 5">
                  <c:set var="totalPageNumber" value="${pageRecord.totalPage }"></c:set>
                </c:if> <c:forEach var="item" varStatus="status" begin="1" end="${totalPageNumber }">
                    <a href="index?page=${status.index }">${status.index }</a>
                </c:forEach>
              </span>
            </div>
          </div>
        </form>
      </div>
    </div>
    <!--/main-->
  </div>
</body>
</html>
